<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="model.*"%>
<%@ page import="dao.*"%>
<%@ page import="java.util.*"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	List<Hotel> hotels = new ArrayList<Hotel>();
	hotels = HotelDao.getHotels();
	request.setAttribute("hotels", hotels);
%>
<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8" />
<title>酒店住宿</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1" name="viewport" />
<meta content="" name="description" />
<meta content="" name="author" />
<link
	href="http://fonts.googleapis.com/css?family=Hind:300,400,500,600,700"
	rel="stylesheet" type="text/css">
<link href="vendor/simple-line-icons/simple-line-icons.min.css"
	rel="stylesheet" type="text/css" />
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet"
	type="text/css" />
<link href="css/animate.css" rel="stylesheet">
<link href="vendor/swiper/css/swiper.min.css" rel="stylesheet"
	type="text/css" />

<!-- THEME STYLES -->
<link href="css/layout.min.css" rel="stylesheet" type="text/css" />

<!-- Favicon -->
<link rel="shortcut icon" href="favicon.ico" />
</head>
<!-- END HEAD -->

<!-- BODY -->
<body id="body" data-spy="scroll" data-target=".header">
	<jsp:include page="Header.jsp" flush="true"></jsp:include>


	<!-- Latest Products -->
	<div id="酒店住宿">
		<div class="content-lg container">
			<div class="row margin-b-40">
				<div class="col-sm-6">
					<h2>酒店住宿</h2>
					<p></p>
				</div>
			</div>
			<!--// end row -->

			<div class="row">
				<c:forEach var="hotel" items="${hotels }" varStatus="status">
					<div class="col-sm-6 sm-margin-b-50">
						<div class="margin-b-20">
							<img class="img-responsive" src="<%=request.getContextPath()%>/${hotel.location }"
								alt="Latest Products Image">
						</div>
						<h4>
							<p>酒店姓名&nbsp;:&nbsp;${hotel.name }</p>
							<p>价格&nbsp;:&nbsp;${hotel.price }</p>
							<p>剩余酒店&nbsp;:&nbsp;${hotel.sum }</p>
							<p>酒店信息&nbsp;:&nbsp;${hotel.info }</p>
						</h4>
						<a class="link"
							href="javascript:if(confirm('确定要添加订单吗?'))
					location='<%=request.getContextPath()%>/HorderServlet?hemail=${hotel.email }&handle=addHorder'">
							添加到订单</a>

						<br><br><br>
					</div>
				</c:forEach>
			</div>
			<!--// end row -->
		</div>
	</div>
	<!-- End Latest Products -->

	<jsp:include page="Footer.jsp" flush="true"></jsp:include>

	<!-- Back To Top -->
	<a href="javascript:void(0);" class="js-back-to-top back-to-top">Top</a>

	<!-- JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
	<!-- CORE PLUGINS -->
	<script src="vendor/jquery.min.js" type="text/javascript"></script>
	<script src="vendor/jquery-migrate.min.js" type="text/javascript"></script>
	<script src="vendor/bootstrap/js/bootstrap.min.js"
		type="text/javascript"></script>

	<!-- PAGE LEVEL PLUGINS -->
	<script src="vendor/jquery.easing.js" type="text/javascript"></script>
	<script src="vendor/jquery.back-to-top.js" type="text/javascript"></script>
	<script src="vendor/jquery.smooth-scroll.js" type="text/javascript"></script>
	<script src="vendor/jquery.wow.min.js" type="text/javascript"></script>
	<script src="vendor/swiper/js/swiper.jquery.min.js"
		type="text/javascript"></script>
	<script src="vendor/masonry/jquery.masonry.pkgd.min.js"
		type="text/javascript"></script>
	<script src="vendor/masonry/imagesloaded.pkgd.min.js"
		type="text/javascript"></script>

	<%
		String flag = "";
		String scerror = "";
		flag = (String) request.getAttribute("flag");
		System.out.println("jspflag" + flag);
		if (flag != null) {
			if (flag.equals("1")) {
				scerror = "添加成功。";
				out.print("<script language='javascript'>alert('" + scerror + "');</script>");
			}
			if (flag.equals("0")) {
				scerror = "添加失败。";
				out.print("<script language='javascript'>alert('" + scerror + "');</script>");
			}

		}
		System.out.println(scerror);
	%>
	<!-- PAGE LEVEL SCRIPTS -->
	<script src="js/layout.min.js" type="text/javascript"></script>
	<script src="js/components/wow.min.js" type="text/javascript"></script>
	<script src="js/components/swiper.min.js" type="text/javascript"></script>
	<script src="js/components/masonry.min.js" type="text/javascript"></script>
	<script src="js/components/google-map.min.js" type="text/javascript"></script>

</body>
<!-- END BODY -->
</html>